

<?php
	require("../../DBops.php");
	session_start();
	
	$teamid=$_GET['teamid'];

	if(isset($_POST['select_admin']))
	{
		echo $_POST['select_admin'];
		$arry = explode("__",$_POST['select_admin']);
		$con = connect("localhost", "root", "", "lab");

		$sql = "update personalinfo set adminID = 0 where projecteamID =$teamid ";
		$result = mysql_query($sql, $con);
		//$count=mysql_num_rows($result);

		
				
		foreach($arry as $ID)
		{
			echo $ID."<br />";
			$sql = "update personalinfo set adminID = $teamid where ID = '$ID'";
			mysql_query($sql, $con);
		}
	}
	else
	{
		echo "<br />not isset";
	}
 echo"<script>location.href='Team.php?teamid=$teamid'</script>";
?>